﻿using System;
using System.Activities;
using System.Activities.Validation;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/// \namespace WFExtended.Framework.Constraints Generic Constraints for custom Activity

namespace WFExtended.Framework.Constraints
{
    /// <summary>
    /// Base Activity Constraint
    /// </summary>
    /// <typeparam name="A">Type of the activity to check</typeparam>
    public abstract class AConstraint<A>
        where A : Activity
    {
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="isWarning">Define if the constraint is a warning</param>
        /// <param name="propertyName">Contraint property name</param>
        public AConstraint(bool isWarning, string propertyName)
        {
            IsWarning = isWarning;
            PropertyName = propertyName;
        }

        /// <summary>
        /// Get if the constraint is a warning
        /// </summary>
        public bool IsWarning { get; protected set; }

        /// <summary>
        ///  Get Contraint property name
        /// </summary>
        public string PropertyName { get; protected set; }

        /// <summary>
        /// Get the activity Constraint
        /// </summary>
        /// <returns>Return the activity Constraint</returns>
        public abstract Constraint<A> GetConstraint();
    }
}
